﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Day03
{
    interface Interface01
    {
        void Fun1();
    }
    interface Interface02
    {
        void Fun2();
    }
    //接口间多继承
    interface Interface03:Interface01,Interface02
    {
        void Fun3();
    }
    //类与类单继承
    //类与接口多实现
    class Test01 : Interface01,Interface02
    {
        public void Fun1()
        {
            throw new NotImplementedException();
        }

        public void Fun2()
        {
            throw new NotImplementedException();
        }
    }
    //类继承类同时实现接口，将唯一的类放到“冒号”后，接口放到“逗号”后
    class Test02 : Program, Interface03
    {
        public void Fun1()
        {
            Console.WriteLine("Fun1");
        }

        public void Fun2()
        {
            Console.WriteLine("Fun2");
        }

        void Interface03.Fun3()//此时不能有访问级别
        {
            throw new NotImplementedException();
        }
    }

    interface Interface04
    {
        void Fun1();
    }
    class Test03 : Interface01, Interface04
    {
        //既是Interface01也是Interface04的接口方法
        //public void Fun1(){}
        //————————显示实现接口————————
        void Interface01.Fun1()//此时不能有访问级别
        {
            Console.WriteLine("Interface01--Fun1");
        }

        void Interface04.Fun1()//此时不能有访问级别
        {
            Console.WriteLine("Interface04--Fun1");
        }
    }
}
